/*
package com.ssfeng.youxia.services;

import com.ssfeng.youxia.mapper.YouxiaUserMapper;
import com.ssfeng.youxia.model.YouxiaUser;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.lang.reflect.InvocationTargetException;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class UserService {

	private static final Logger logger = LoggerFactory.getLogger(UserService.class);

    @Autowired
    private YouxiaUserMapper youxiaUserMapper;

    @Autowired
	private PasswordService passwordService;
	*/
/***
	 * 新增用户
	 * @param youxiaUser
	 * @return
	 *//*

	public YouxiaUser saveYouxiaUser(YouxiaUser youxiaUser) {
		youxiaUser.setCreateTime(new Date());
		if (StringUtils.isEmpty(youxiaUser.getPassword())) {
			throw new RuntimeException("密码不能为空!");
		}
		if (StringUtils.isEmpty(youxiaUser.getName())) {
			throw new RuntimeException("用户名不能为空!");
		}
		String name=youxiaUser.getName();
		final String[] params=new String[] {name};
		List<YouxiaUser> list = null;
		if (CollectionUtils.isNotEmpty(list)) {
			throw new RuntimeException("用户名重复!");
		}
		//加密算法
		String password = passwordService.encodeShiroPassword(youxiaUser.getPassword());
		youxiaUser.setPassword(password);
		youxiaUser.setStatus(new Byte("0"));
		int userId=youxiaUserMapper.insert(youxiaUser);
		return youxiaUser;
	}


	*/
/***
	 * 根据用户名查询用户
	 * @param userName
	 * @return
	 * @throws IllegalAccessException
	 * @throws NoSuchMethodException
	 * @throws InvocationTargetException
	 *//*

	public YouxiaUser queryYouxiaUserByName(String userName) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException {
		Map<String, Object> map = new HashMap<>();
		map.put("name", userName);
		YouxiaUser youxiaUser = youxiaUserMapper.findTopOne("selectList", map);
		return youxiaUser;
	}

	*/
/***
	 * shiro 加载用户权限
	 * @param userId
	 * @return
	 *//*

	*/
/*public Set<String> queryUserPermission(Serializable userId) {
		Set<String> set=new HashSet<>();
		List<YouxiaUserPermission> permissionsList=baseDao.queryForList(" from YouxiaUserPermission where userId = ? ", new Object[] {userId});
		if (CollectionUtils.isNotEmpty(permissionsList)) {
			for (YouxiaUserPermission youxiaUserPermission : permissionsList) {
				if (StringUtils.isNotEmpty(youxiaUserPermission.getYouxiaMenu().getUrl())) {
					set.add(youxiaUserPermission.getYouxiaMenu().getUrl());
				}
			}
		}
		return set;
	}*//*


	*/
/*****
	 * 更新密码用于测试
	 * @param userId
	 * @param passwordNew
	 *//*

	public void updateUserPassword(Long userId,String passwordNew){
		YouxiaUser youxiaUser = youxiaUserMapper.selectByPrimaryKey(userId);
		String password = passwordService.encodeShiroPassword(passwordNew);
		youxiaUser.setPassword(password);
		youxiaUserMapper.updateByPrimaryKey(youxiaUser);
	}
}
*/
